package com.oa.modules.approvalsec1.dao;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.oa.modules.approvalsec1.entity.EnterpriseEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;

/**
 * 企业表
 *
 * @author yangwenzhi
 * @email 785297226@qq.com
 * @date 2022-01-13 10:37:13
 */
@Mapper
public interface EnterpriseDao extends BaseMapper<EnterpriseEntity> {


    /**
     * 查询总条数
     *
     * @author yangwenzhi
     * @email 785297226@qq.com
     * @date 2022-01-13 10:37:13
     * @Description 查询分页数据
     */
    @Select("<script>select count(0) from enterprise t1 " +
            "where 1=1 " +
            "ORDER BY t1.CREATE_DATE desc</script>")
    long findPage(@Param("params") Map<String, Object> params);

    /**
     * 查询分页数据
     *
     * @author yangwenzhi
     * @email 785297226@qq.com
     * @date 2022-01-13 10:37:13
     * @Description 查询分页数据
     */
    @Select("<script>select t1.* from enterprise t1 " +
            "where 1=1 " +
            "ORDER BY t1.CREATE_DATE desc</script>")
    List<EnterpriseEntity> findRecords(IPage<EnterpriseEntity> page, @Param("params") Map<String, Object> params);

}
